<html>
    <head>
        <meta http-equiv=Content-Type content="text/html; charset=UTF-8">
    </head>
<body>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<?php
    require_once "../funciones.php";
    $con = con_intranetpccom();
    $reqId = $_REQUEST['rq'];
    $sql = "select * from requerimientos where reqId = $reqId";
    $result = mysql_query($sql,$con) or die("Error 1".mysql_error().$sql);
    $result = mysql_fetch_array($result);
    echo "<table border='1'>";
    echo "<caption>Historial de la Incidencia</caption>";
    echo "<tr>";
    echo "<th>Inc</th>";
    echo "<th>Descripcion</th>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>$reqId</td>";
    echo "<td>{$result['reqDes']}</td>";
    echo "</tr>";
    echo "</table>";
    echo "<br/><br/><br/><br/>";
    $sql = "select sol.solRqFec as Fecha,concat(usr.nombres,' ',usr.apellidos) as Usuario,estRqNombre as Estado,tipRqNombre as Tipo,solRqDes as Contenido from solucionesRq sol ";
    $sql .= "inner join usuarios usr on usr.username = sol.solRqUsr ";
    $sql .= "inner join estadosRq est on est.estRqId = sol.estRqId ";
    $sql .= "inner join tiposRq   tip on tip.tipRqId = sol.tipRqId ";
    $sql .= "where sol.reqId = $reqId";

// change these to match your mySQL host's settings
mysql_connect("localhost", "caweb", "caweb");
mysql_select_db("intranetpccom");

// require the class
require "../librerias/grilla/class.datagrid.php";
// instantiate the class and pass the query string to it
$grid = new dataGrid($sql);

// show all the columns
$grid->showColumn("Fecha");
$grid->showColumn("Usuario");
$grid->showColumn("Estado");
$grid->showColumn("Tipo");
$grid->showColumn("Contenido");

// sort the data by the "title" column
$grid->setDefaultSortColumn("Fecha");

// witness magic!
$grid->render();

?>
</body>
</html>
